<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="zh">
 <head>
  <meta content="width=device-width, initial-scale=1.0" name="viewport"/>
  <meta content="2018-10-23T06:18:10.521000000" name="created"/>
  <meta content="2023-12-12T09:31:23" name="changed" translator="gocpicnic"/>
  <meta content="text/html; charset=utf-8" http-equiv="content-type"/>
  <meta content="zh" http-equiv="Content-Language"/>
  <title>
   AND/OR/NAND/NOR Gate
  </title>
  <link href="../../style.css" rel="stylesheet" type="text/css"/>
 </head>
 <body>
  <div class="maindiv">
   <table>
    <tbody>
     <tr>
      <td>
       <img alt="#########" class="iconlibs" height="32" src="../../../../icons/6464/ansandgate.png" width="32"/>
       <img alt="#########" class="iconlibs" height="32" src="../../../../icons/6464/ansorgate.png" width="32"/>
       <img alt="#########" class="iconlibs" height="32" src="../../../../icons/6464/ansnandgate.png" width="32"/>
       <img alt="#########" class="iconlibs" height="32" src="../../../../icons/6464/ansnorgate.png" width="32"/>
       <br/>
       <img alt="#########" class="iconlibs" height="32" src="../../../../icons/6464/iecandgate.png" width="32"/>
       <img alt="#########" class="iconlibs" height="32" src="../../../../icons/6464/iecorgate.png" width="32"/>
       <img alt="#########" class="iconlibs" height="32" src="../../../../icons/6464/iecnandgate.png" width="32"/>
       <img alt="#########" class="iconlibs" height="32" src="../../../../icons/6464/iecnorgate.png" width="32"/>
      </td>
      <td valign="center">
       <h1>
        <em>
         AND/OR/NAND/NOR Gate
        </em>
       </h1>
      </td>
     </tr>
    </tbody>
   </table>
   <table>
    <tbody>
     <tr>
      <td>
       <strong>
        Library:
       </strong>
      </td>
      <td>
       <a href="index.html">
        Gates
       </a>
      </td>
     </tr>
     <tr>
      <td>
       <strong>
        Introduced:
       </strong>
      </td>
      <td>
       2.0 Beta 1
      </td>
     </tr>
     <tr>
      <td valign="top">
       <!-- <strong>Appearance:</strong> -->
       <strong>
        外观符号:
       </strong>
      </td>
      <td valign="top">
       <table>
        <tbody>
         <tr>
          <th>
          </th>
          <th width="50">
           AND
          </th>
          <th width="50">
           OR
          </th>
          <th width="50">
           NAND
          </th>
          <th width="50">
           NOR
          </th>
         </tr>
         <tr>
          <th align="left">
           ANSI:
          </th>
          <td>
           <img alt="#########" class="appearancelibs" height="64" src="../../../../img-libs/ansandgate.png" width="64"/>
          </td>
          <td>
           <img alt="#########" class="appearancelibs" height="64" src="../../../../img-libs/ansorgate.png" width="64"/>
          </td>
          <td>
           <img alt="#########" class="appearancelibs" height="64" src="../../../../img-libs/ansnandgate.png" width="64"/>
          </td>
          <td>
           <img alt="#########" class="appearancelibs" height="64" src="../../../../img-libs/ansnorgate.png" width="64"/>
          </td>
         </tr>
         <tr>
          <th align="left">
           IEC:
          </th>
          <td>
           <img alt="#########" class="appearancelibs" height="64" src="../../../../img-libs/iecandgate.png" width="64"/>
          </td>
          <td>
           <img alt="#########" class="appearancelibs" height="64" src="../../../../img-libs/iecorgate.png" width="64"/>
          </td>
          <td>
           <img alt="#########" class="appearancelibs" height="64" src="../../../../img-libs/iecnandgate.png" width="64"/>
          </td>
          <td>
           <img alt="#########" class="appearancelibs" height="64" src="../../../../img-libs/iecnorgate.png" width="64"/>
          </td>
         </tr>
        </tbody>
       </table>
      </td>
     </tr>
    </tbody>
   </table>
   <h2>
    Behavior
   </h2>
   <p>
    <!-- The AND, OR, NAND, and NOT gates each compute the respective function of the inputs, and emit the result on the output. -->
    AND、OR、NAND 和 NOT 门各自计算输入的相应函数，并在输出上发出结果。
   </p>
   <p>
    <!-- By default, any inputs that are left unconnected are ignored — that's if the input truly has nothing attached to it, not even a wire. In this way, you can insert a 5-input gate but only attach two inputs, and it will work as a 2-input gate; this relieves you from having to worry about configuring the number of inputs every time you create a gate.<br>        If all inputs are unconnected, the output is the error value (<b class="evalue">E</b>). Some users, though, prefer that Logisim insist that all inputs be connected, since this is what corresponds to real-world gates. You can enable this behavior by going to the <b class="menu">|&nbsp;Project&nbsp;|</b> &gt; <b class="menu">|&nbsp;Options…&nbsp;|</b> menu item and selecting the <b class="menu">|&nbsp;Simulation&nbsp;|</b> tab, and selecting <q>Error for undefined inputs</q> for <q>Gate Output When Undefined</q>. -->
    默认情况下，任何未连接的输入都会被忽略——也就是说，如果输入确实没有任何连接，甚至没有电线。 这样，您可以插入一个 5 输入门，但只附加两个输入，它将作为 2 输入门工作； 这使您不必担心每次创建门时配置输入数量。
    <br/>
    如果所有输入均未连接，则输出为错误值 (
    <b class="evalue">
     E
    </b>
    ) 。 不过，一些用户更喜欢 Logisim-evolution 坚持连接所有输入，因为这对应于现实世界的门。 您可以通过转到
    <b class="menu">
     | Project |
    </b>
    &gt;
    <b class="menu">
     | Options… |
    </b>
    menu item and selecting the
    <b class="menu">
     | Simulation |
    </b>
    tab, and selecting
    <q>
     Error for undefined inputs
    </q>
    for
    <q>
     Gate Output When Undefined
    </q>
    。
   </p>
   <p>
    <!-- The two-input truth table for the gates is the following. The letter <b class="evalue">E</b> represents the error value, and the letter <b class="uvalue">U</b> represents the floating value. -->
    门的双输入真值表如下。 字母
    <b class="evalue">
     E
    </b>
    代表错误值，字母
    <b class="uvalue">
     U
    </b>
    代表浮动值。
   </p>
   <center>
    <table border="0" class="encapsul">
     <tbody>
      <tr>
       <td>
        <table class="truthtable">
         <tbody>
          <tr>
           <th colspan="4">
            AND
           </th>
          </tr>
          <tr>
           <td class="tspace">
            -
           </td>
           <td class="tzerov">
            0
           </td>
           <td class="tunov">
            1
           </td>
           <td class="tspace">
            <b class="uvalue">
             U
            </b>
            /
            <b class="evalue">
             E
            </b>
           </td>
          </tr>
          <tr>
           <td class="tzerov">
            0
           </td>
           <td class="zerov">
            0
           </td>
           <td class="zerov">
            0
           </td>
           <td class="zerov">
            0
           </td>
          </tr>
          <tr>
           <td class="tunov">
            1
           </td>
           <td class="zerov">
            0
           </td>
           <td class="unov">
            1
           </td>
           <td class="evalue">
            E
           </td>
          </tr>
          <tr>
           <td class="tspace">
            <b class="uvalue">
             U
            </b>
            /
            <b class="evalue">
             E
            </b>
           </td>
           <td class="zerov">
            0
           </td>
           <td class="evalue">
            E
           </td>
           <td class="evalue">
            E
           </td>
          </tr>
         </tbody>
        </table>
       </td>
       <td>
       </td>
       <td>
        <table class="truthtable">
         <tbody>
          <tr>
           <th colspan="4">
            OR
           </th>
          </tr>
          <tr>
           <td class="tspace">
            -
           </td>
           <td class="tzerov">
            0
           </td>
           <td class="tunov">
            1
           </td>
           <td class="tspace">
            <b class="uvalue">
             U
            </b>
            /
            <b class="evalue">
             E
            </b>
           </td>
          </tr>
          <tr>
           <td class="tzerov">
            0
           </td>
           <td class="zerov">
            0
           </td>
           <td class="unov">
            1
           </td>
           <td class="evalue">
            E
           </td>
          </tr>
          <tr>
           <td class="tunov">
            1
           </td>
           <td class="unov">
            1
           </td>
           <td class="unov">
            1
           </td>
           <td class="unov">
            1
           </td>
          </tr>
          <tr>
           <td class="tspace">
            <b class="uvalue">
             U
            </b>
            /
            <b class="evalue">
             E
            </b>
           </td>
           <td class="evalue">
            E
           </td>
           <td class="unov">
            1
           </td>
           <td class="evalue">
            E
           </td>
          </tr>
         </tbody>
        </table>
       </td>
      </tr>
      <tr>
       <td>
       </td>
       <td>
       </td>
       <td>
       </td>
      </tr>
      <tr>
       <td>
        <table class="truthtable">
         <tbody>
          <tr>
           <th colspan="4">
            NAND
           </th>
          </tr>
          <tr>
           <td class="tspace">
            -
           </td>
           <td class="tzerov">
            0
           </td>
           <td class="tunov">
            1
           </td>
           <td class="tspace">
            <b class="uvalue">
             U
            </b>
            /
            <b class="evalue">
             E
            </b>
           </td>
          </tr>
          <tr>
           <td class="tzerov">
            0
           </td>
           <td class="unov">
            1
           </td>
           <td class="unov">
            1
           </td>
           <td class="unov">
            1
           </td>
          </tr>
          <tr>
           <td class="tunov">
            1
           </td>
           <td class="unov">
            1
           </td>
           <td class="zerov">
            0
           </td>
           <td class="evalue">
            E
           </td>
          </tr>
          <tr>
           <td class="tspace">
            <b class="uvalue">
             U
            </b>
            /
            <b class="evalue">
             E
            </b>
           </td>
           <td class="unov">
            1
           </td>
           <td class="evalue">
            E
           </td>
           <td class="evalue">
            E
           </td>
          </tr>
         </tbody>
        </table>
       </td>
       <td>
       </td>
       <td>
        <table class="truthtable">
         <tbody>
          <tr>
           <th colspan="4">
            NOR
           </th>
          </tr>
          <tr>
           <td class="tspace">
            -
           </td>
           <td class="tzerov">
            0
           </td>
           <td class="tunov">
            1
           </td>
           <td class="tspace">
            <b class="uvalue">
             U
            </b>
            /
            <b class="evalue">
             E
            </b>
           </td>
          </tr>
          <tr>
           <td class="tzerov">
            0
           </td>
           <td class="unov">
            1
           </td>
           <td class="zerov">
            0
           </td>
           <td class="evalue">
            E
           </td>
          </tr>
          <tr>
           <td class="tunov">
            1
           </td>
           <td class="zerov">
            0
           </td>
           <td class="zerov">
            0
           </td>
           <td class="zerov">
            0
           </td>
          </tr>
          <tr>
           <td class="tspace">
            <b class="uvalue">
             U
            </b>
            /
            <b class="evalue">
             E
            </b>
           </td>
           <td class="evalue">
            E
           </td>
           <td class="zerov">
            0
           </td>
           <td class="evalue">
            E
           </td>
          </tr>
         </tbody>
        </table>
       </td>
      </tr>
     </tbody>
    </table>
   </center>
   <p>
    <!-- In short, these components work as expected as long as all inputs are either 0 or 1. If an input is neither 0 nor 1. it is floating (<b class="uvalue">U</b>) or it is the error (<b class="evalue">E</b>) value then the component treats it as both 0 <em>and</em> 1: If the output would be the same both ways as when an AND gate has one input that is definitely 0 and a questionable second input, that will be the output value; but if the output changes depending on whether it is 0 or 1, the output is the error value (<b class="evalue">E</b>). -->
    简而言之，只要所有输入都是 0 或 1，这些元件就会按预期工作。如果输入既不是 0 也不是 1，则它是浮动的 (
    <b class="uvalue">
     U
    </b>
    ) 或者是 error (
    <b class="evalue">
     E
    </b>
    ) 值，则元件将其视为 0
    <em>
     和
    </em>
    1：如果输出与 AND 门具有相同的两种方式 第一个输入肯定为 0，第二个输入有问题，这将是输出值； 但如果输出根据 0 或 1 的不同而变化，则输出为错误值 (
    <b class="evalue">
     E
    </b>
    )。
   </p>
   <p>
    <!-- The multi-bit versions of each gate will perform its one-bit transformation bitwise on its inputs. -->
    每个门的多位版本将对其输入按位执行其一位转换。
   </p>
   <h2>
    <!-- Pins (assuming component faces east) -->
    引脚（假设元件朝东）
   </h2>
   <dl>
    <dt>
     <!-- West edge : -->
     西边：
    </dt>
    <dd>
     <!-- The inputs into the component. There will be as many of these as specified in the Number of Inputs attribute. Bit width according to Data <b class="propertie">Bits attribute</b>. -->
     元件的输入。 输入数量属性中指定的数量将相同。 位宽度根据数据
     <b class="propertie">
      位属性
     </b>
     。
     <p>
      <!-- Note that if you are using shaped gates the west side of OR and NOR gates will be curved. Nonetheless, the input pins are in a line. Logisim will draw short stubs illustrating this; and if you overshoot a stub, it will silently assume that you did not mean to overshoot it. In "printer view", these stubs will not be drawn unless they are connected to wires. -->
      请注意，如果您使用异形门，“或”门和“或非”门的西侧将是弯曲的。 尽管如此，输入引脚还是排成一行。 Logisim-evolution 将绘制短存根来说明这一点； 如果你超过了一个存根，它会默默地认为你并不是故意超过它的。 在“打印机视图”中，除非将这些存根连接到电线，否则不会绘制这些存根。
     </p>
    </dd>
    <dt>
     East edge :
    </dt>
    <dd>
     <!-- The gate's output, whose value is computed based on the current inputs as described above. Bit width according to Data <b class="propertie">Bits attribute</b>. -->
     门的输出，其值是根据如上所述的当前输入计算的。 位宽度根据数据
     <b class="propertie">
      位属性
     </b>
     。
    </dd>
   </dl>
   <h2>
    <!-- Attributes -->
    属性
   </h2>
   <p>
    <!-- When the component is selected or being added the digits <b class="tkeybd">0</b> through <b class="tkeybd">9</b> alter its <b class="propertie">Number of Inputs</b> attribute, <b class="tkeybd">Alt-0</b> through <b class="tkeybd">Alt-9</b> alter its <b class="propertie">Data Bits</b> attribute, and the arrow keys alter its <b class="propertie">Facing</b> attribute. -->
    当选择或添加元件时，数字
    <b class="tkeybd">
     0
    </b>
    到
    <b class="tkeybd">
     9
    </b>
    会改变其
    <b class="propertie">
     输入数量
    </b>
    属性，
    <b class="tkeybd">
     Alt-0
    </b>
    到
    <b class="tkeybd">
     Alt-9
    </b>
    更改其
    <b class="propertie">
     数据位&lt; /b&gt; 属性，方向键更改其
     <b class="propertie">
      方向
     </b>
     属性。
    </b>
   </p>
   <div class="attliste">
    <dl>
     <dt>
      <!-- <b class="propertie">Facing</b> -->
      <b class="propertie">
       方向
      </b>
     </dt>
     <dd>
      <!-- The direction of the component (its output relative to its inputs). -->
      元件的方向（其输出相对于其输入）。
     </dd>
     <dt>
      <!-- <b class="propertie">Data Bits</b> -->
      <b class="propertie">
       数据位
      </b>
     </dt>
     <dd>
      <!-- The bit width of the component's inputs and outputs. -->
      元件输入和输出的位宽度。
     </dd>
     <dt>
      <!-- <b class="propertie">Gate Size</b> -->
      <b class="propertie">
       数据位
      </b>
     </dt>
     <dd>
      <!-- Determines whether to draw a wider or narrower version of the component. This does not affect the number of inputs, which is specified by the Number of Inputs attribute. However, if shaped gates are selected, then the gate will be drawn with <q>wings</q> to accommodate additional inputs beyond what the shape naturally accommodates. -->
      确定是否绘制较宽或较窄版本的元件。 这不会影响输入数量，输入数量由“输入数量”属性指定。 但是，如果选择了形状门，则门将被绘制为带有
      <q>
       翼
      </q>
      ，以容纳超出形状自然容纳范围的额外输入。
     </dd>
     <dt>
      <!-- <b class="propertie">Number of Inputs</b> -->
      <b class="propertie">
       输入数量
      </b>
     </dt>
     <dd>
      <!-- Determines how many pins to have for the component on its west side. -->
      确定元件在其西侧有多少个引脚。
     </dd>
     <dt>
      <!-- <b class="propertie">Output Value</b> -->
      <b class="propertie">
       输出值
      </b>
     </dt>
     <dd>
      <!-- Indicates how false and true results should be translated into output values. By default, false is indicated by a low voltage (0) and true by a high voltage (1), but one or the other can be replaced by a high-impedance (<q>floating</q>) value instead. This allows wired-or and wired-and connections, as illustrated below: At left, the buffers' Output Value attribute is floating/1 and the resistor pulls to 0, giving wired-or behavior; at right, the buffers' Output Value attribute is 0/floating and the resistor pulls to 1, giving wired-and behavior. -->
      指示如何将错误和正确的结果转换为输出值。 默认情况下，假由低电压 (0) 表示，真由高电压 (1) 表示，但其中之一可以用高阻抗（
      <q>
       浮动
      </q>
      ）值代替。 这允许线或和线与连接，如下图所示： 在左侧，缓冲器的输出值属性为浮动/1，电阻器拉至 0，从而提供线或行为； 在右侧，缓冲器的输出值属性为 0/浮动，电阻器拉至 1，呈现有线与行为。
      <center>
       <img alt="#########" height="91" src="../../../../img-libs/wand-wor.png" width="220"/>
      </center>
     </dd>
     <dt>
      <!-- <b class="propertie">Label</b> -->
      <b class="propertie">
       标签
      </b>
     </dt>
     <dd>
      <!-- The text within the label associated with the gate. -->
      与门关联的标签内的文本。
     </dd>
     <dt>
      <!-- <b class="propertie">Label Font</b> -->
      <b class="propertie">
       标签字体
      </b>
     </dt>
     <dd>
      <!-- The font with which to render the label. -->
      用于呈现标签的字体。
     </dd>
     <dt>
      <!-- <b class="propertie">Negate <var>x</var></b> -->
      <b class="propertie">
       否定
       <var>
        x
       </var>
      </b>
     </dt>
     <dd>
      <!-- If <q>yes</q>, the input is negated before it is fed into the gate. The inputs are counted top-down if the facing is east or west, and they are counted left-to-right if the facing is north or south. -->
      如果
      <q>
       yes
      </q>
      ，则输入在送入门之前被否定。 如果面向东或西，则输入从上到下计数；如果面向北或南，则从左到右计数。
     </dd>
    </dl>
   </div>
   <h2>
    <!-- Poke Tool Behavior -->
    Poke 工具行为
   </h2>
   <p>
    <!-- None. -->
    无
   </p>
   <h2>
    <!-- Text Tool Behavior -->
    文本工具行为
   </h2>
   <p>
    <!-- Allows the label associated with the gate to be edited. -->
    允许编辑与门关联的标签。
   </p>
   <p>
    <!-- <b>Back to</b> <a href="../index.html">Library Reference</a> -->
    <b>
     返回
    </b>
    <a href="../index.html">
     电路元件库参考手册
    </a>
   </p>
  </div>
 </body>
</html>
